#ifndef TMSESSIONMANAGER_H
#define TMSESSIONMANAGER_H

#include <QtCore>
#include "Ice/Ice.h"
#include "IceUtil/IceUtil.h"
#include "Glacier2/Glacier2.h"
#include "RobotDef.h"

//=========Session Manager=========//
class ClientSessionManagerI;

class ClientSessionI : public Glacier2::Session
{
private:
    ClientSessionManagerI* m_sessionMgr;
public:
    ClientSessionI(const ClientSessionManagerI* pMgr);
    virtual void ice_ping(const Ice::Current& cur) const;
    virtual void destroy(const::Ice::Current & cur) override;
};

class ClientSessionManagerI : public Glacier2::SessionManager
{
private:
    std::map< ClientSessionI*, std::string> m_mapSession;
    IceUtil::Mutex m_MapMutex;
public:
    void remove_session(ClientSessionI* pSession);
    void list_session(Ice::StringSeq& strList);

    virtual Glacier2::SessionPrx create(const std::string& userId, const Glacier2::SessionControlPrx& sPrx, const Ice::Current& current);
};


#endif // TMSESSIONMANAGER_H
